<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Form Tag Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.error {
    color: red;
}
.error_input {
    background-color: red;
}
</style>
</head>
<body>
<h1 align="center">Form Tag Example</h1>

<h2>Description:</h2>
This page demonstrates how to use &#123;&#123;form:errors&#125;&#125; &lt; and &#123;&#123;form:field_errors&#125;&#125; &lt; tags.
<P/>Try to send an empty form and you will see errors list above the form.

Note the <b>title</b> attribute of &#123;&#123;input&#125;&#125; tag - it used in error messages to display correct input field name

<? if(isset($this->text)) { ?>
<p/>You typed: <b>{$#text}</b>
<? } ?>

{{form name='my_form' method='POST'}}

{{form:errors to='$errors'}}

{{list using='$errors'}}
Form errors:<p/>
<ul>
 {{list:item}}
  <li><b>{$item.message}</b></li>
 {{/list:item}}
</ul>
{{/list}}

{{form:field_errors to='$my_field_errors'}}

{{list using="$my_field_errors"}}
Field errors (you can place field error near form field):<p/>
<ul>
 {{list:item}}
  <li>(for field "{$item.id}")<b>{$item.message}</b></li>
 {{/list:item}}
</ul>
{{/list}}

{{label for='my_input' error_class='error'}}Type here:<br/>{{/label}}
{{input type='text' id='my_input' name='my_input' title='Field Full Name' error_class='error_input'/}}

<input type='submit' name='button' value='Send!'/>
{{/form}}

</body>
</html>
